// component/j-textTab/j-textTab.js
var app = getApp()
Component({
	/**
	 * 组件的属性列表
	 */
	properties: {
		keyCatid: {
			type: Number,
			value: 0,
			observer: function (newVal, oldVal) {
				var that = this;
				wx.request({
					url: app.globalData.host + 'index.php/api/goods/classify?admin_id=' + app.globalData.admin_id + '&parent_id=' + newVal,
					success: function (e) {
						console.log(e)
						that.setData({
							list: e.data.data
						})
					}
				})
			}
		},
		width: {
			type: Number,
			value: 25,
		},
		color:{
			type: String,
			value: '#cecece',
		}
	},

	/**
	 * 组件的初始数据
	 */
	data: {
		curIndex: 0
	},

	/**
	 * 组件的方法列表
	 */
	methods: {
		onClick: function (e) {
			console.log(e)
			this.setData({
				curIndex: e.currentTarget.dataset.index
			})
			this.triggerEvent('clickevent', e.currentTarget.dataset)
		}
	}
})
